package com.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.model.Student;
import com.service.StudentService;

@RestController
public class Controller {
	
    @Autowired
    private StudentService studentService;

	    @RequestMapping(value = "/find/name/{name}")
	    public List<Student> getStudentByName(@PathVariable String name)
	    {
	        List<Student> students = studentService.findByName(name);
	        return students;
	    }
}
